package com.atguigu.composite;

public class Client {
    public static void main(String[] args) {
        //创建学校
        OrganizationComponent university = new University("清华大学", "中国顶级大学");
        //创建院系
        OrganizationComponent college = new College("计算机学院", "计算机专业");
        OrganizationComponent college2 = new College("信息工程学院", "信息工程学院");
        //创建专业
        OrganizationComponent department = new Department("计算机科学与技术", "计算机科学与技术");
        OrganizationComponent department2 = new Department("软件工程", "软件工程");
        OrganizationComponent department3 = new Department("网络工程", "网络工程");
        OrganizationComponent department4 = new Department("通信工程", "通信工程");
        OrganizationComponent department5 = new Department("信息工程", "信息工程");

        university.add(college);
        university.add(college2);

        college.add(department);
        college.add(department2);
        college.add(department3);

        college2.add(department4);
        college2.add(department5);

        university.print();
        System.out.println("================");
        college.print();
        System.out.println("================");
        department.print();
    }
}
